<!DOCTYPE html>
<html>
<#include "../head.html">
<body class="full">
<table class="mc">
    <tr>
        <td class="mc-l">
            <!--左侧导航---{-->
            <div id="navPanelContainer">
                <div class="system-logo cd"></div>
                <!--管理员信息---{-->
                    <#include "../adminInfo.html">
                <!--管理员信息---}-->
                <div class="nav-wrap">
                    <#include "left.html">
                </div>
            </div>
            <!--左侧导航---}-->
        </td>
        <td class="mc-m">
            <div class="navToggle"></div>
        </td>
        <td class="mc-r">
            <!--顶部导航---{-->
            <#include "../topNav.html">
            <!--顶部导航---}-->

            <!--面包屑导航---{-->
            <#assign moduleName="已放款借款">
            <#include "banner.html">
            <!--面包屑导航---}-->

            <!--工具栏--{-->
            <div id="toolbar" class="clearfix">
                <#if param??&&param.status??>
                    <#assign status=(param.get("status"))?number >
                        <#else>
                            <#assign status=-1>
                </#if>
                <div class="toolbor-module search">
                    <input type="button" value="搜索"  class="input-button" onclick="sousuo();">
                </div>
                
                <div class="toolbor-module search">
                    <div class="formTit">状态：</div>
                   
                    <div class="select-box" id="status">
                        <div class="tag-select">全部</div>
                        <ul class="tag-options">
                            <li data-value="" >全部</li>
                            <li data-value="6" >还款中</li>
                            <li data-value="7" >部分还款</li>
                            <li data-value="8" >还款成功</li>
                        </ul>
                    </div>
                </div>
                
                <div class="toolbor-module search">
                	<div class="formTit">资产管理公司：</div>
                	<div class="select-box" id="fid">
                        <div class="tag-select">全部</div>
                        <ul class="tag-options">
                            <li data-value="" >全部</li>
                            <#if fList??>
                            <#list fList as item>
                             <li data-value="${item.id?c}" >${item.name}</li>
                            </#list>
                            </#if>
                        </ul>
                    </div> 
                </div>
                
                <div class="toolbor-module search">
                 	<div class="formTit">用户名：</div>
                    <input type="text" name="username" id="username" value="请输入用户名"  class="search-value">
                </div>
                
                <div class="toolbor-module search">
                	<div class="formTit">项目名：</div>
                    <input type="text" name="name" id="name" value="请输入项目名"  class="search-value">
                </div>
                
                <!-- <div class="toolbor-module search">
                    <input type="button" value="今日待还项目"  class="input-button" onclick="timeLimitSearch(0);">
                </div>
                
                <div class="toolbor-module search">
                    <input type="button" value="最近3天待还项目"  class="input-button" onclick="timeLimitSearch(3);">
                </div> -->
            </div>
            <!--工具栏--}-->

            <div id="main" class="clearfix">
                <form action="" method="post">
                    <table class="data-list">
                        <tr class="header">
                            <td>ID</td>
                            <td>资产管理公司</td>
                            <td>项目名</td>
                            <td>项目金额</td>
                            <td>年利率</td>
                            <td>借款期限</td>
                            <td>发布时间</td>
                            <td>还款人</td>
                            <td>真实姓名</td>
                            <td>预期还款时间</td>
                            <td>联系方式</td>
                            <td>状态</td>
                            <td>操作</td>
                        </tr>
                        <#import "../../common/function.html" as func>
                            <#list list as item>
                            	<!-- 排除流转标和还款完成的借款 -->
	                            <#if item.type!=110 && item.status!=8>
	                            	<#assign repayTime=getRepayDatetime(item)>
	                                <#assign today=dateroll(dateformat("now")?c,0,0,0,"yyyy-MM-dd HH:mm:ss")>
	                                <#assign prevDay=dateroll(dateformat("now")?c,0,0,3,"yyyy-MM-dd HH:mm:ss")>
	                                <#if dateformat(today) gte dateformat(repayTime)>
                               			<#assign tstyle="color:red;">
	                                <#elseif dateformat(prevDay) gte dateformat(repayTime)>
	                                	<#assign tstyle="color:orange;">
	                                <#else>
	                                	<#assign tstyle="">
	                                </#if>
	                           <#else>
                                	<#assign tstyle=""> 
	                            </#if>
                                <tr class="s" style="${tstyle!}">
                                    <td>${(item.id!)?c}</td>
                                    <td>${item.franchisee.name!}</td>
                                    <td title="${item.name}" class="tal"><@func.borrowTypeName item=item />_${item.name!}</td>
                                    <td>${item.account!0}元</td>
                                    <td>${item.apr!}%</td>
                                    <td><#if item.isday==1>${item.timeLimitDay!"-"}天<#else>${item.timeLimit!"-"}个月</#if></td>
                                    <td>${(item.addtime)?string("yyyy-MM-dd")}</td>
                                    <td>${item.user.showName!}</td>
                                    <td>${item.user.realName!}</td>
                                   	<td>${getRepaytime(item)}</td>
                                    <td>${item.user.phone!"-"}</td>
                                    <td><@func.statusTypeName status=item.status type=item.type /></td>
                                    <td>
                                        <dd><a class="un" href="${request.getContextPath()}/admin/borrow/viewRepayingBorrow.html?id=${item.id?c}" >查看</a></dd>
                                    </td>
                                </tr>
                            </#list>
                    </table>
                    <input type="hidden" id="timeLimit" name="timeLimit" value="" />
                </form>

                <!--底部工具栏--{-->
                <div id="bottomToolbar" class="clearfix">
                    <div class="other-tool">
                        <dl class="refresh-data">
                            <dt class="refresh-data-icon"></dt>
                            <dd><a href="javascript:void(0);" class="refresh-page">刷新数据</a></dd>
                        </dl>
                    </div>

                    <!--翻页系统--{-->
                    <div class="container s_formPage">
                        <#import "../../common/page.html" as pager>
                            <@pager.pagination page=page url="${pageUrl}" map=param style="style1" />
                    </div>
                    <!--翻页系统--}-->
                </div>
                <!--底部工具栏--}-->

                <script>
                    var urls = '?search=true';
                    function sousuo(){
                        var sou = "";
                        var username = $("#username").val();
                        if (username!=null&&username!=""&&username!="undefine"&&username!="请输入用户名"){
                            sou += "&username="+username;
                        }
                        var name = $("#name").val();
                        if (name!=null&&name!=""&&name!="undefine"&&name!="请输入项目名"){
                            sou += "&name="+name;
                        }
                        var fid = $("#fid").find(".open-selected").attr("data-value");
                        if (fid!=null&&fid!=""&&fid!="undefine"){
                            sou += "&fid="+fid;
                        }
                        var status = $("#status").find(".open-selected").attr("data-value");
                        if (status!=null&&status!=""&&status!="undefine"){
                            sou += "&status="+status;
                        }
                        var timeLimit = $("#timeLimit").val();
                        if(timeLimit!=null&&timeLimit!=""&&timeLimit!="undefine"){
                        	sou += "&timeLimit="+timeLimit;
                        }
                        var url=urls+sou
                        location.href=url;
                    }
                    function timeLimitSearch(timeLimit) {
                    	$("#timeLimit").val(timeLimit);
                    	sousuo();
                    }
                </script>
            </div>

        </td>
    </tr>
    <tr>
        <!--尾部--{-->
        <td colspan="3" class="mc-b"><#include "../foot.html"></td>
        <!--尾部--}-->
    </tr>
</table>
</body>
</html>
<#include "../jsPage.html">
